import java.util.logging.Logger;

/**
 * 静态代理模式
 * StaticProxy
 */
public class StaticProxy {

    private static void write(Proxy ukraine) {
        ukraine.attack();
    }

    public void test() {
        var logger = new Proxy(new Ukraine());
        write(logger);
    }

    public static void main(String[] args) {
        var staticProxy = new StaticProxy();
        staticProxy.test();
    }
}

// 代理类
class Proxy implements NATO {

    Ukraine ukraine;

    Proxy(Ukraine ukraine) {
        this.ukraine = ukraine;
    }

    @Override
    public void attack() {
        Logger.getGlobal().info("search Russia");
        ukraine.attack();
        Logger.getGlobal().info("destroy");
    }
}



